<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title></title>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="http://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css">
    <link rel="stylesheet" href="/assets/css/project.css">
    <script src="http://cdn.bootcss.com/jquery/2.1.1/jquery.min.js"></script>
    <script src="http://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<style>
    .ipu{
        margin: 20px 10%;
        width: 80%;
    }
    .main-log{
        margin-top:40%;
    }
    .login-btn{
        width: 33%;
        margin-top: 25px;
        margin-left: 33%
    }
</style>
<body style="background: #2b669a">
<div class="row">
    <div class="main-log">
        <h3 style="text-align: center;color: #f0f0f0">登录系统</h3>
        <div class="form-item">
            <input type="text" id="phone" class="form-control ipu form-inline" placeholder="输入手机号">
        </div>
        <div class="form-item">
            <input type="password" id="password" class="form-control ipu form-inline" placeholder="输入密码">
        </div>
        <button class="btn btn-success login-btn">登录</button>
    </div>
</div>
<script>
    $('.login-btn').click(function(){
        var phone=$('#phone').val();
        var password=$('#password').val();
        $.ajax({
            url:"{:url('login')}",
            data:{phone:phone,password:password},
            type:"POST",
            success:function (res){
                if(res.code==0){
                    alert(res.msg);
                }else{
                    window.location.href="{:url('user/info')}";
                }
            }
        })
    })
</script>
</body>
</html>